package myThread;

public class demo23 {
    public static void main(String[] args) throws InterruptedException {
        Object object1 = new Object();
        System.out.println("wait之前");
        synchronized(object1){
            System.out.println("等待中");
            object1.wait();
            System.out.println("结束等待");
        }
        System.out.println("wait之后");
    }
}
